#ifndef __CSCREENSAVERENGINE_H__
#define __CSCREENSAVERENGINE_H__

#include <e32base.h>
#include <w32std.h>
#include <screensaverplugin.h>


_LIT( ScreenSaverEngineName, "ScreenSaverEngine" );



class CScreenSaverEngine :public MScreensaverPlugin
{
public:
	//CScreenSaverEngine(void);
	~CScreenSaverEngine(void);

	//////////////////////////////////////////////////////////////////////////
	///   from MScreensaverPlugin
	//////////////////////////////////////////////////////////////////////////
    
    /**
    * Used to initialize the plugin module after creation.
    * Name() function may be called without the plugin being initialized,
    * to enable name query from modules that are not plugin hosts.
    *
    * @param aHost  Screen saver plugin host.
    * @return KErrNone if everything went ok. Otherwise 
    *         system wide error code.
    */
    virtual TInt InitializeL(MScreensaverPluginHost *aHost);
	/**
    * When a plugin module is active this method is called every time 
    * when refresh timer expires in screensaver application.
    *
    * @param aGc  Graphics context for plugin module to draw to.
    * @return KErrNone if everything went ok. Otherwise 
    *         system wide error code (doesn't have any effect in
    *         current version).
    */
    virtual TInt Draw(CWindowGc& aGc);
	/**
        * Returns the name of plugin module. Returned name is displayed in
        * the list of installed plugin modules in personalization application.
        *
        * @return Descriptor containing the name of the plugin module.
        */
        virtual const TDesC16& Name() const;


        /**
        * Handler function for screensaver events.
        *
		* @param aEvent Event to be handled.
		* @param aData  Currently not used, reserved for future purposes.
		*
        * @return Should always return KErrNone.
        */
		virtual TInt HandleScreensaverEventL(TScreensaverEvent aEvent,
            								 TAny* aData);
        
        
        /**
        * Screensaver plugin capabilities query. The capabilitities
        * reveal which functions the plugin implements, that can be
        * used by calling PluginFunction)(.
        *
        * @return Bit mask of plugin capabilities.
        */
        virtual TInt Capabilities() { return EScpCapsNone; }

		  /**
        * Screensaver plugin function method. Only the functions
        * returned by Capabilities() can be used, and only one
        * function at a time.
        *
        * @paran aFunction
        * @param aParam Parameters to the function. TBD function-by-function.
        * 
        * @return System wide error code. KErrNone on success.
        */
        virtual TInt PluginFunction(TScPluginCaps /*aFunction*/,
            						TAny* /*aParam*/)
		{
			 return KErrNone;
		}

private:
	MScreensaverPluginHost* 	iHost; 
};



#endif 